package com.fenghongzhang.kuaishou.index.home.presenter;

import com.fenghongzhang.kuaishou.index.home.contract.AttentFragmentContract;
import com.fenghongzhang.kuaishou.index.home.entity.VideoBean;
import com.fenghongzhang.kuaishou.utils.ResponseBean;
import com.fenghongzhang.mvp_lib.presenter.BasePresenter;

import java.util.List;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

public class AttentPresenter extends BasePresenter<AttentFragmentContract.IAttentModel,AttentFragmentContract.IAttentlView> {


    public AttentPresenter(AttentFragmentContract.IAttentModel mModel, AttentFragmentContract.IAttentlView mView) {
        super(mModel, mView);

    }

    public void getVideoList(){
        mModel.getVideoList(new Observer<ResponseBean<List<VideoBean>>>() {
            @Override
            public void onSubscribe(Disposable d) {
                disposable = d;
            }

            @Override
            public void onNext(ResponseBean<List<VideoBean>> listResponseBean) {
                mView.initAdapter(listResponseBean);
            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onComplete() {

            }
        });
    }
}
